package com.training.java.core.collections.post15;

/**
 * This class is designed for Cellphone object
 * 
 * @author soumya
 * 
 */
public class CellPhone {

	private String company;
	private String model;
	private String description;
	private String operatingSystem;
	private int price;

	CellPhone(String company, String model, String operatingSystem, int price) {
		this.company = company;
		this.model = model;
		this.operatingSystem = operatingSystem;
		this.price = price;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getOperatingSystem() {
		return operatingSystem;
	}

	public void setOperatingSystem(String operatingSystem) {
		this.operatingSystem = operatingSystem;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public boolean equals(Object obj) {
		CellPhone that = (CellPhone) obj;

		if (this.company.equals(that.company) && this.model.equals(that.model)
				&& this.operatingSystem.equals(that.operatingSystem)) {

			return true;
		} else {
			return false;
		}

	}

	@Override
	public int hashCode() {

		return company.hashCode() + model.hashCode()
				+ operatingSystem.hashCode();
	}
}
